﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="fileDown.aspx.cs" Inherits="FileDownLoadDemo.fileDown" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>文件下载Demo</title>
    <script src="jquery-1.8.0.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            /*在下载的时候，可以防止弹出窗口*/
            //$("#iDownload").attr("src", "download.ashx?filename=" + encodeURI($(this).children("span").first().text()));  
        })
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div style="width: 500px; margin-left: 30%;">
        <center style="background-color: #bef189;">
            <p>
                <iframe id="iDownload" style="display: none;"><span></span></iframe>
            </p>
            <p>
                <asp:Button ID="btnTransmitFileDown" runat="server" Text="TransmitFile方式下载" Width="240px"
                    Height="40px" Font-Size="20px" OnClick="btnTransmitFileDown_Click" />
            </p>
            <p>
                <asp:Button ID="btnWriteFile" runat="server" Text="WriteFile方式下载" Width="240px" Height="40px"
                    Font-Size="20px" OnClick="btnWriteFile_Click" />
            </p>
            <p>
                <asp:Button ID="btnFileInfo" runat="server" Text="WriteFile分块方式下载" Width="240px"
                    Height="40px" Font-Size="20px" OnClick="btnFileInfo_Click" />
            </p>
            <p>
                <asp:Button ID="btnFileStream" runat="server" Text="字符流方式下载" Width="240px" Height="40px"
                    Font-Size="20px" OnClick="btnFileStream_Click" />
            </p>
            <p>
            </p>
            <p>
                <asp:Button ID="Button1" runat="server" Text="字符流方式下载" Width="240px" Height="40px"
                    Font-Size="20px" OnClick="Button1_Click" />
            </p>
        </center>
    </div>
    </form>
</body>
</html>
